<?php
require_once 'connect.php';


class keywords extends db {
    public $table_name;
    public $query;
    
     public function setTable($table){
        $this->table_name=$table;           
    }
    public function getQuery(){
        return $this->query;
    }
    
    public function setQuery($query){
        $this->query=$query;           
    }
    public  function insert($keywords){
       $query="INSERT $this->table_name (id, name) values($words[0])";
    }
    public  function select(){
        $rows=array();
        $query="SELECT * FROM $this->table_name";
        $result=mysql_query($query);
        while ($row=  mysql_fetch_assoc($result))
         $rows[]=$row;
        return $rows;
    }
    
    public  function oneSelect($where){
        $query="SELECT * FROM $this->table_name $where";
        $result=mysql_query($query);
        $row=  mysql_fetch_assoc($result);
        return $row;
    }
    
    public function countKeywords(){
        $count=0;
        $query="SELECT * FROM $this->table_name";
        $result=mysql_query($query);
        while ($row=  mysql_fetch_assoc($result))
         $count++;
        return $count;
    }
    
}